<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>最后一个单词的长度</title>
	</head>
	<body>
		<script>
			var str = 'Hello World ';
			function show(string){
				var aa = string.trim().split(' ');
				return aa[aa.length-1].length;
			}
			console.log(show(str));
		</script>
	</body>
</html>
